package com.example.activiti.event;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.ExecutionListener;

/**
 * 请假流程结束事件
 */
public class LeaveOverEvent implements ExecutionListener {

    @Override
    public void notify(DelegateExecution execution) {
        boolean isApprove = execution.getVariable("approve") != null && Boolean.parseBoolean(execution.getVariable("approve").toString());
        String processInstanceId = execution.getProcessInstanceId();
        System.out.println("请假流程" + processInstanceId +"已经结束！" + (isApprove ? "审批通过" : "审批不通过"));
        int i = 0/0;
    }
}
